{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$info.title}{/block}
{block name="head_keword"}{$info.keywords?:$info.title}  {$s_info.name} {/block}
{block name="head_description"}{:get_word(del_html($info['content']),300)}{/block}

{block name="body_content"}
{include file="content/notice" /}
<link rel="stylesheet" href="__STATIC__/group/show.css">	
<div class="MainContainer">
	<!--ul class="TopCntBox">
		<li class="home"><a href="#"><i class="fa fa-reply"></i> 首页</a></li>
		<li class="name">圈友排行版</li>
		<li class="member"><a href="#"><i class="fa fa-user-o"></i></a></li>
	</ul-->	
<style type="text/css">
.qun-head{
	background:#fff;
	position:relative;
}
.qun-head .qun-icon{
	position:absolute;
	z-index:1;
	left:5px;
	bottom:0px;
	width:90px;
	height:90px;
	border-radius: 100%;
}
.qun-head .qun-v{
	position:absolute;
	width:20px;
	height:20px;
	z-index:2;
	left:80px;
	bottom:0px;
}
.qun-head .word{
	padding-top:5px;	
	height:35px;
}
.qun-head span{
	display:block;
	float:right;
	border:1px solid #3897F1;
	padding:0px 16px 0px 16px;
	margin-right:15px;
	font-size:13px;
	border-radius: 3px;
}
.qun-head span.join{
	color:#fff;
	background:#3897F1;
}
.qun-head .banner{
	background:url({$info.banner}) no-repeat;	
	background-position:center center;
}
.qun-head .banner img{
	width:100%;
}
</style>
<script type="text/javascript">
var load_err_pic = false;
function load_banner(o){
	if(load_err_pic==true){
		return ;
	}
	if(o.width>o.height){
		if(o.height<120){
			$(o).parent().css({'background-size':'auto 120px','height':'120px'});
		}else{
			$(o).parent().css({'background-size':'auto '+o.height+'px','height':o.height+'px'});
		}
	}else{
		if(o.height>250){
			$(o).parent().css({'background-size':'100% auto','height':'250px'});
		}else{
			$(o).parent().css({'background-size':'100% auto','height':o.height+'px'});
		}		
	}
	$(o).hide();
}
function load_err_banner(o){
	load_err_pic = true;
	o.src='__STATIC__/group/hyshow/shopbanner.jpg';
	$(o).show();
}
</script>
	<div class="qun-head">
	     <img class="qun-icon" src="{$info.picurl}" onerror="this.src='__STATIC__/images/nopic.png'"> 
		{if $info.status==2}<img class="qun-v" src="__STATIC__/group/v.png">{/if}
		<div class="banner"><img onload="load_banner(this)" onerror="load_err_banner(this);" src="{$info.banner}"></div>
		<div class="word"> {eq name="gid" value=""}
						 <span class="join" onclick="joinGroup({$id})">关注</span> 
						{else /}
						 <span class="join" onclick="quitGroup({$id})">退群</span> 
						{/eq} <span><a href="{:murl('member/msg/add',['uid'=>$info.uid])}" class="_pop">发消息</a></span> 
						 
						</div>
	</div>

	 
	
<style type="text/css">
.SideBox .head .qun-title{
	font-weight:bold;
	font-size:17px;
}
.aboutcnt .cnt{
	font-size:14px;
	line-height:21px;
}
.aboutcnt .nav{
	font-size:12px;
}
.aboutcnt .nav em{
	font-size:15px;
	font-weight:bold;
	margin-left:10px;
	margin-right:3px;
}
.aboutcnt .nav em.left{
	margin-left:0;
}
.aboutcnt .nav span{
	margin-left:8px;
}
</style>
	<div class="SideBox">
		<div class="head"><span class="tag qun-title">{$info.title}</span></div>
		<div class="aboutcnt">			
			<div class="cnt">{:fun('area@get',$info.city_id)} {:fun('area@get',$info.zone_id)} {:fun('area@get',$info.street_id)}<br>{$info.content}</div>
			<div class="nav"><em class="left">{$info.view}</em>人气 <em>{:fun('qun@count','qun_member',$info.id)}</em>粉丝
				<!--<span onclick="$('.MoreInfoBox').fadeIn();$('.MoreInfoBox').css({'display':'flex'});"><i class="fa fa-fw fa-qrcode"></i></span>-->
				<span onclick="share_btn();"><i class="fa fa-fw fa-qrcode"></i></span>
				{eq name="$info.uid" value="$userdb.uid"}<span onclick="window.location.href='{:murl('qun/content/edit',['id'=>$id])}'"><i class="fa fa-fw fa-gear"></i></span>{/eq}
				<span onclick="window.location.href='{:urls('map/index',['aid'=>$id])}'"><i class="fa fa-fw fa-flag-checkered"></i></span>
				<span onclick="SharShowMsg()"><i class="fa fa-fw fa-share-square-o"></i></span>
				{if plugins_config('signin')}<span onclick="window.location.href='{:purl('signin/index/index',['id'=>$id])}'"><i class="fa fa-calendar"></i></span>{/if}
			</div>	
		</div>
		{if plugins_config('voicehb')}<div class="hongbaoBox" style="opacity: 0.4;"><a href="{:urls('voicehb/index',['aid'=>$id])}"><img src="__STATIC__/plugins/voicehb/hongbao.png"></a></div>
		{elseif(plugins_config('hongbao')) /}<div class="hongbaoBox" style="opacity: 0.4;"><a href="{:urls('hongbao/index',['aid'=>$id])}"><img src="__STATIC__/plugins/hongbao/hongbao.png"></a></div>
		{/if}		
	</div>

	
	<!--
	<div class="SideBox" >
		<div class="head"><span class="tag">共有成员{$info.usernum}人</span><a href="{:urls('member/index',['id'=>$id])}" class="more">查看更多</a></div>
		<ul class="listMember qun_member_wapshow">
			{qb:tag name="qun_member_wapshow" class="app\qun\model\Member@get_label" rows="5" where="aid=$id" js="qun_member_wapshow"}
			<li><a href="{:get_url('user',$rs.uid)}"><span><img src="{$rs.icon}" onerror="this.src='__STATIC__/images/nobody.gif'"></span><em>{$rs.username}</em></a></li>
			{/qb:tag}
		</ul> 
	</div>
	-->

<style type="text/css">
.MainMenu{
	padding: 3px;
}
.MainMenu ul li span,.MainMenu ul li em{
	width:55px;
}
.MainMenu ul li span i{
	font-size:22px;
}
.MainMenu ul li em{
	overflow: hidden;
	font-size:13px;
}
</style>

	<div class="SideBox">
		<div class="MainMenu">
			<ul>
				<li>
					{qb:hy name="wap_qun_link01" type="link"}		
					<!--<a href="{:urls('shop/index',['aid'=>input('id')])}"><span><i class="fa fa-shopping-basket"></i></span><em>热卖产品</em></a>-->
					<a href="{$url}"><span><i class="{$logo}"></i></span><em>{$title}</em></a>
					{/qb:hy}
				</li>
				<li>
					{qb:hy name="wap_qun_link04" type="link"}
					<!--<a href="{:urls('cms/index',['aid'=>input('id'),'mid'=>1])}"><span><i class="fa fa-file-text-o"></i></span><em>行业资讯</em></a>-->
					<a href="{$url}"><span><i class="{$logo}"></i></span><em>{$title}</em></a>
					{/qb:hy}
				</li>
				
				<li>
					{qb:hy name="wap_qun_link02" type="link"}
					<!--<a href="javascript:share_btn();"><span><i class="fa fa-fw fa-qrcode"></i></span><em>分享码</em></a>-->
					<a href="{$url}"><span><i class="{$logo}"></i></span><em>{$title}</em></a>
					{/qb:hy}
				</li>
				<li>
					{qb:hy name="wap_qun_link03" type="link"}
					<!--<a href="{:get_url('msg','-'.input('id'))}"><span><i class="fa fa-comments-o"></i></span><em>群聊</em></a>-->
					<a href="{$url}"><span><i class="{$logo}"></i></span><em>{$title}</em></a>
					{/qb:hy}
				</li>
			</ul>
		</div>
	</div>

<!--
{if empty($webdb.qun_hide_shop)}
	<div class="SideBox">
		<div class="head"><span class="tag">推荐商品</span><a href="{:urls('shop/index',['id'=>$id])}" class="more">更多</a></div>
		<ul class="listPhoto qun_wapshow_photo001">
			{php}$sys_type=modules_config('appstore')?'appstore':(modules_config('booking')?'booking':'shop');{/php}
			{//这里是动态判断调用不同的频道数据}
			{qb:hy name="qun_wapshow_photo001" type="shop" union="sys_type" mid="1" where="uid=$info.uid" order="id" by="desc" rows="2" js="qun_wapshow_photo001"}
			<li><a href="{$rs.url}"><span><img src="{$rs.picurl}" onerror="this.src='__STATIC__/images/nopic.png'"></span><em>{$rs.title}</em></a>
			<i class="glyphicon glyphicon-remove-sign act-delete" data-id="{$rs.id}" data-uid="{$rs.uid}" data-sys="shop"></i>
			</li>
			{/qb:hy}
		</ul>
		<div class="qb_ui_showmore" onclick='showMorePhoto("{qb:hy_url name="qun_wapshow_photo001"/}")'><i class="fa fa-angle-double-down"></i></div>
	</div>
{/if}
<script type="text/javascript">
var shop_photo_page = 1;
function showMorePhoto(url){
	shop_photo_page++;
	$.get(url+shop_photo_page,function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
				//$('.ShowMore1').hide();
				$('.qb_ui_showmore').hide();
			}else{
				$('.qun_wapshow_photo001').append(res.data);
				act_delete();
				//act_top():
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}
</script>
-->

<!--快速发表内容开始<link rel="stylesheet" href="__STATIC__/layui/css/layui.css" media="all"><link rel="stylesheet" href="__STATIC__/layui/css/admin.css" media="all"><link rel="stylesheet" href="__STATIC__/layui/css/template.css" media="all">{// include file="content/quick_post"}-->

<!--分享二维码
<div class="MoreInfoBox">
	<div class="BackBox" onclick="$('.MoreInfoBox').fadeOut();"></div>
	<div class="ShowinfoBox">
{if (config('webdb.wxapp_appid')&&config('webdb.wxapp_appsecret'))}
						<a href="{// fun('wxapp@qun_code',$id)}"><img src="{// fun('wxapp@qun_code',$id)}"></a>
{else /}
						<img src="{// get_qrcode(urls('show',['id'=>$id,'my_qid'=>$id]))}">
{/if}	
	</div>
</div>
-->

<!--圈子各个频道的数据调用-->
{include file="content/more_content" /}

<script type="text/javascript">
//加入圈子
function joinGroup(id){
	var url = "{:urls('wxapp.member/join',['id'=>$id])}?"+Math.random();
	$.get(url,function(res){
		if(res.code==0){
			layer.alert("加入成功！");
			//$(".JoinBut").hide();
		}else if(res.code==2){
			join_need_sn(url);
		}else{
			layer.alert("加入失败:"+res.msg);
		}	
	});
}
function join_need_sn(url){
	var index = layer.prompt({
		   title : '请输入正确的授权码,才能加入',
		   formType:0,
	},function(val, index){
		$.post(url,{'sncode':val},function(res){
			if(res.code==0){
				layer.msg('加入成功');
				layer.close(index);
			}else{
				layer.msg('加入失败,'+res.msg,{time:1000});
			}
		});		
	});
}


//退出
function quitGroup(id){
	layer.confirm('你确认要退出吗?', {icon: 3, title:'提示'}, function(index){
		layer.close(index);
		$.get("{:urls('wxapp.member/quit',['id'=>$id])}?"+Math.random(),function(res){
			if(res.code==0){
				layer.alert("你已退出！");
				//$(".JoinBut").hide();
			}else{
				layer.alert("退出失败:"+res.msg);
			}	
		})		
	});
}

//function addpost(){
//	var obj = $('.MorePost');
//	obj.is(':hidden') ? obj.show() : obj.hide();
//}

$.get("{:urls('wxapp.visit/check_visit',['id'=>$id])}",function(res){
		if(res.code==0){
			//layer.msg("更新浏览量成功!");
		}else{
			//layer.msg("并没有更新到浏览量!");
		}	
});
</script>

<!--  发布内容的按钮 -->
{include file="qun@post_btn" /}

<!--  商家设置菜单 -->
{include file="qun@set" /}



<!-- 微信分享插件 -->
{include file="index@share"/}

<!--
微信分享插件里边有这段代码了
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
-->
<script type="text/javascript">
wx.miniProgram.getEnv(function (res) { 
	if (res.miniprogram==true) { 
		var info = { 
			title: '{$info.title}',
			picurl: '{$info.picurl}',
			url: "{:get_url(urls('show',['id'=>$id]))}?my_qid={$id}&p_uid={$userdb.uid}",
		}; 
		var json = JSON.stringify(info); 
		wx.miniProgram.postMessage({ 
			data: info, 
		}); 
	} 
}); 
</script>

<!-- 分享海报二维码宣传推广图片 -->
{include file="$haibao" /}
{include file="../../../haibao_style/btn" /}
<!--<div style="position:fixed;right:30px;top:80px;z-index:200;width:30px;font-size:10px;line-height:10px;color:#000;opacity:0.7;"><i id="share_code" onclick="share_btn()" style="font-size:30px;" class="fa fa-qrcode"></i>海报</div>-->

{/block}